﻿using SqlSugar;

namespace Zhp.Workflow.Models
{
    public class BaseWorkflowInfo
    {
        /// <summary>
        /// 主键
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime? SubmitTime { get; set; }

        public long? SubmitUserId { get; set; }

        public string SubmitNickName { get; set; }

        /// <summary>
        /// 流程实例ID
        /// </summary>
        public string WorkflowInstanceId { get; set; }
        public string WorkflowName { get; set; }
        /// <summary>
        /// 审批状态
        /// </summary>
        public ApproveStatusEnum ApproveStatus { get; set; }
        public string ApproveStatusText { get; set; }
        /// <summary>
        /// 流程状态
        /// </summary>
        public WorkflowStatusEnum WorkflowStatus { get; set; }
        public string WorkflowStatusText { get; set; }

        /// <summary>
        /// 审批按钮
        /// </summary>
        public string ApproveText {  get; set; }

        /// <summary>
        /// 被审批个数
        /// </summary>
        public int? ApprovedCount { get; set; }

        /// <summary>
        /// 表单是否可以操作,修改，提交，删除按钮控制
        /// </summary>
        public bool IsEditForm 
        {
            get
            {
                return ApproveStatus == ApproveStatusEnum.Rejected || WorkflowStatus == WorkflowStatusEnum.NotStarted || WorkflowStatus == WorkflowStatusEnum.Cancelled;
            } 
        }
    }
}
